// phalanx addressof.hpp.cu header file

// Copyright (c) 2010 - 2011 Kohei Takahashi (Flast).
// Distributed under the MIT license. for more detail see COPYING.

// Redefinition C++0x's addressof

#ifndef IG_PHALANX_UTILITY_ADDRESSOF_HPP_CU_ONCE_
#define IG_PHALANX_UTILITY_ADDRESSOF_HPP_CU_ONCE_

#include <phalanx/config.hpp.cu>

namespace phalanx
{

template < typename T >
PHALANX_CONFIG_DEFAULT_FUNCTION( true )
T *
addressof( T &v )
{
    return reinterpret_cast< T * >( &const_cast< char & >(
      reinterpret_cast< const volatile char & >( v ) ) );
}

} // namespace phalanx

#endif // IG_PHALANX_UTILITY_ADDRESSOF_HPP_CU_ONCE_

